package com.thinking.live.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum InformStateEnum {

    CANCEL(-1, "取消"),
    TOP_up(0, "充值中"),
    SUCCEED(1, "充值成功"),
    FAIL(2, "充值失败"),
    PART_SUCCEED(3, "部分成功");

    private Integer code;

    private String name;

    public static String getName(Integer code) {
        for (InformStateEnum value : InformStateEnum.values()) {
            if (value.getCode().equals(code)) {
                return value.getName();
            }
        }
        return null;
    }
}
